package com.haier.npt.security.resource;

import java.util.Set;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.haier.npt.common.JsonResult;
import com.haier.npt.security.domain.SysPermission;
import com.haier.npt.security.dto.RequestInfoDTO;


/**
 * 权限项维护
 */
public interface SysPermissionResource {
		
	/**
	 * 根据url和serviceid 查询
	 * @param url
	 * @param serviceId
	 * @return
	 */
	@RequestMapping(value="/internal/permissions/percode", method =RequestMethod.POST)
	public JsonResult<Set<String>> getPermissionCode(@RequestBody RequestInfoDTO requestInfoDTO) ; 
	
	/**
	 *  根据权限编号删除一个权限项
	 * @param id
	 * @return
	 */
	@RequestMapping(value="/permissions/{permissionId}/delete", method =RequestMethod.POST)
	public JsonResult<Boolean> delPermissionById(Long id); 
	
	/**
	 * 添加一个权限项
	 * @param sysPermission
	 */
	@RequestMapping(value="/permissions/add", method =RequestMethod.POST )
	public JsonResult<Boolean> addPermission(@RequestBody SysPermission sysPermission); 
	
}
